package com.osdp.gateway.util;

public class TokenHolder {
    private TokenHolder(){
        throw new AssertionError("TokenHolder 不允许初始化");
    }

    private static final ThreadLocal<String> tokenHolder = new InheritableThreadLocal<>();

    public static void setToken(String token){
        tokenHolder.set(token);
    }

    public static String getToken(){
        return tokenHolder.get();
    }

    public static void removeToken(){
        tokenHolder.remove();
    }
}
